/*
 * EventNetwork.h
 *
 *  Created on: Jun 3, 2010
 *      Author: sdaniele
 */

#ifndef EVENTNETWORK_H_
#define EVENTNETWORK_H_

#include "../users/EventUser.h"
#include "common.h"
#include <string>
#include <vector>
#include <assert.h>

namespace noti {


class EventNetwork {
private:
	::std::string m_name;
	bool m_is_thread;
	sc_event m_event;
	::std::vector<EventUser*> m_users;
	const sc_clock* m_curr_clock;

public:
	EventNetwork(::std::string name, bool is_thread);
	virtual ~EventNetwork();

	//fluent interface design
	EventNetwork& clock(const sc_clock* clk);
	EventNetwork& immediate(size_t n);
	EventNetwork& delta(size_t n);
	EventNetwork& timed(size_t n, const sc_time& t);
	EventNetwork& cancel(size_t n);
	EventNetwork& sensitive(size_t n);

private:
	//counters for naming of different instances
	unsigned long m_clock_cnt;
	unsigned long m_immediate_cnt;
	unsigned long m_delta_cnt;
	unsigned long m_timed_cnt;
	unsigned long m_cancel_cnt;
	unsigned long m_sensitive_cnt;
};

}

#endif /* EVENTNETWORK_H_ */
